<template>
  <div>
    <el-descriptions class="margin-top" direction="vertical" :column="1" border>
      <el-descriptions-item>
        <template slot="label" disabled>
          <i class="el-icon-user"></i>
          教工号
        </template>
        <span>{{ t_id }} </span>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-mobile-phone"></i>
          用户名
        </template>
        {{ user_name }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          姓名
        </template>
        {{ teacher_name }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          密码
        </template>
        {{ user_password }}
        <el-button icon="el-icon-view" size="mini" circle @click="viewpassword"  style="float:right"></el-button>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          手机号码
        </template>
        {{ phone }}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-tickets"></i>
          身份
        </template>
        <el-tag size="small">教师</el-tag>
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
export default {
  data() {
    return {
      t_id: JSON.parse(sessionStorage.getItem("teacher")).t_id,
      user_name: JSON.parse(sessionStorage.getItem("teacher")).user_name,
      user_password: '*******',
      teacher_name: JSON.parse(sessionStorage.getItem("teacher")).teacher_name,
      phone:  JSON.parse(sessionStorage.getItem("teacher")).phone
    };
  },
  methods: {
    viewpassword(){
      this.user_password=JSON.parse(sessionStorage.getItem("teacher")).user_password;
    }
  }
};
</script>

<style>
.margin-top {
  margin-top: 0;
}
.my-content{
  background-color: darkgray;
}
</style>
